package com.whmall.service.crm.module.companybusinesscertificate.service;

import com.whmall.component.service.DbService;
import com.whmall.service.crm.entity.dto.companybusinesscertificate.*;
import com.whmall.service.crm.module.companybusinesscertificate.entity.CompanyBusinessCertificateDO;

import java.util.List;

/**
 * Author：yangdong
 * Date：2020/8/3
 * Description：经营证件业务层
 */
public interface CompanyBusinessCertificateService extends DbService<CompanyBusinessCertificateDO> {

    List<CompanyBusinessCertificateRspDTO> listBy(CompanyBusinessCertificateQueryReqDTO queryReqDTO);

    /**
     * 根据查询条件查询
     *
     * @param qo 查询条件
     * @return 结果
     */
    List<CompanyBusinessCertificateDTO> listBy(CompanyBusinessCertificateListQO qo);

    CompanyBusinessCertificateRspDTO getById(Long id);

    void insert(SaveCompanyBusinessCertificateReqDTO businessCertificateReqDTO);

    void update(SaveCompanyBusinessCertificateReqDTO businessCertificateReqDTO);

    int delete(Long id, Integer operatorType, Long operatorId);

    int countEffective(Long id, Long companyId, String certificateNumber);

    /**
     * 根据证照有效期重新验证有效性
     */
    void revalidateEffective();

    /**
     * 查询经营证件是否有存在有效的产品
     *
     * @param id 证件ID
     */
    Boolean isExistsValidProduct(Long id);

}
